/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package officeboost.domain;

import java.io.*;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import officeboost.entity.User;

/**
 *
 * @author sorra
 */
@Stateless
@LocalBean
public class DataImportMgr {

    @EJB
    private LogMgr logger;
    @EJB
    private PersonService personService;

    public void importUsers(FileReader fr) {
	BufferedReader br = new BufferedReader(fr);
	String line = null;
	try {
	    while ((line = br.readLine()) != null) {
		User user = new User();
		personService.extractUser(line.split(" "));
	    }
	} catch (IOException ex) {
	    logger.log("IO: " + ex.getMessage());
	} finally {
	    try {
		br.close();
	    } catch (IOException ex) {
		logger.log("IO: " + ex.getMessage());
	    }
	}
    }
}
